<?php
/* @var $this TicketController */
/* @var $ticket Ticket */
/* @var $form CActiveForm */
?>
<?php Yii::app()->clientScript->registerCssFile('/themes/adminica/css/hometicket.css'); ?>
<div id="hometicket">
		<div id="header">
					<a id="logo" href="/index.php" title="Support Center"><img src="/logo.php" border="0" alt="congkhuong" style="height: 5em"></a>
					<p>
									  Guest User - <a href="/login.php">Log In</a>
								  </p>
		</div>
		<div class="flat_area">
			<ul id="nav">
				<li><a class=" home" href="<?php echo $this->createUrl('/tickets/client/index');?>">Support&nbsp;Center&nbsp;Home</a></li>
				<li><a class="active new" href="<?php echo $this->createUrl('/tickets/client/create');?>">Open&nbsp;New&nbsp;Ticket</a></li>
				<li><a class=" status" href="<?php echo $this->createUrl('/tickets/client/checkStatus');?>">Check Ticket Status</a></li>
			</ul>
		</div>
	<div class="form">
		<div class="section">
			<div class="block">
				<?php
				$form = $this->beginWidget('CActiveForm', array(
					'id' => 'ticket-create-form',
					'enableAjaxValidation' => false,
				));
				?>
				<table class="form-table">
					<tr>
						<th scope="row" width="100"><?php echo $form->labelEx($ticket, 'name'); ?></th>
						<td>
							<?php echo $form->textField($ticket, 'name', array('size' => 30)); ?>
							<?php echo $form->error($ticket, 'name'); ?>
						</td>
					</tr>
					<tr>
						<th scope="row" width="100"><?php echo $form->labelEx($ticket, 'email'); ?></th>
						<td>
							<?php echo $form->textField($ticket, 'email', array('size' => 30)); ?>
							<?php echo $form->error($ticket, 'email'); ?>
						</td>
					</tr>
					<tr>
						<th scope="row" width="100"><?php echo $form->labelEx($ticket, 'mobile'); ?></th>
						<td>
							<?php echo $form->textField($ticket, 'mobile', array('size' => 30)); ?>
							<?php echo $form->error($ticket, 'mobile'); ?>
						</td>
					</tr>
					<tr>
						<td colspan="2">&nbsp;</td>
					</tr>
					<!-- <?php //if (!$ticket->isNewRecord): ?>
						<tr>
							<th scope="row" width="100"><?php //echo $form->labelEx($ticket, 'current_status', array('label' => 'Status')); ?></th>
							<td>
								<?php// echo $form->dropDownList($ticket, 'current_status', CHtml::listData(TicketStatusType::model()->findAll(), 'code', 'code')); ?>
								<?php //echo $form->error($ticket, 'current_status'); ?>
							</td>
						</tr>
					<?php// endif; ?> -->
					<tr>
						<th scope="row" width="100"><?php echo $form->labelEx($ticket, 'ticket_type_id'); ?></th>
						<td>
							<?php echo $form->dropDownList($ticket, 'ticket_type_id', CHtml::listData(TicketType::model()->findAll(), 'id', 'name'), array('prompt' => 'Select Type')); ?>
							<?php echo $form->error($ticket, 'ticket_type_id'); ?>
						</td>
					</tr>
					
					<tr>
						<th scope="row">
							<?php echo $form->labelEx($ticket, 'subject'); ?></th>
						<td>
							<?php echo $form->textField($ticket, 'subject', array('size' => 60)); ?>
							<?php echo $form->error($ticket, 'subject'); ?>
						</td>
					</tr>
					<tr>
						<th scope="row">
						<?php echo $form->labelEx($ticket,'summary'); ?></th>
						<td>
						
							<div class="ckeditor megin">
								<?php $this->widget('common.components.ckeditor.CKEditor', array(
									'model'=>$ticket,
									'attribute'=>'summary',
									'language'=>'en',
									'editorTemplate'=>'advanced',
									'width'	=>	'300px',
									'height'	=>	'420px',
									'options'=>array(
										//'filebrowserUploadUrl'=>$this->createUrl('upload'),
									),
									//'rows'=>10, 
									//'cols'=>30,
									'toolbar'=>array(
										array('Bold', 'Italic', 'Underline', 'Strike'),
										array('JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'),
										array('Format'),
										array( 'Font', 'FontSize', 'FontColor', 'TextColor'),
										'/',
										array('Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord' ),
										array('Image', 'Table', 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'),
										array('Subscript','Superscript'),
										array( 'Link', 'Unlink' ),
										array('Source'),
									)
									)); 
								?>
							</div>
						</td>
					</tr>
					
				</table>
				<div class="row buttons">
					<?php if ($ticket->isNewRecord): ?>
						<?php echo CHtml::submitButton('Submit Ticket', array('class' => 'green')); ?>
					<?php else: ?>
						<?php echo CHtml::submitButton('Update Ticket', array('class' => 'green')); ?>
					<?php endif; ?>

				</div>
				<?php $this->endWidget(); ?>
			</div>
		</div>
	</div><!-- form -->
</div>